package be.telio.freeagent.model;

import javax.xml.bind.annotation.*;
import java.io.Serializable;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "invoice_item")
public class FAInvoiceItem implements FAEntity, Serializable
{
    @XmlElement(name = "id")
    public Integer id;

    @XmlTransient
    public Integer invoiceId;

    @XmlElement(name = "project-id")
    public Integer projectId;

    @XmlElement(name = "description")
    public String description;

    @XmlElement(name = "item-type")
    public String itemType;

    @XmlElement(name = "price")
    public Double price;

    @XmlElement(name = "quantity")
    public Double quantity;

    @XmlElement(name = "sales-tax-rate")
    public Double salesTaxRate;

    @XmlElement(name = "second-sales-tax-rate")
    public Double secondSalesTaxRate;

    public Integer getId()
    {
        return id;
    }

    public String getEntityListName()
    {
        return "/invoices/" + invoiceId + "/invoice_items";
    }
}
